package yun.service;

import java.util.List;

class SequencePlaylist<E> extends Playlist<E> {

	SequencePlaylist(int index, List<E> list) {
		super(index, list);
	}

	@Override
	public boolean hasNext() {
		return hasItem(getIndex() + 1);
	}

	@Override
	public boolean hasPrevious() {
		return hasItem(getIndex() - 1);
	}

	@Override
	public E current() {
		return getList().get(getIndex());
	}

	@Override
	public E next() {
		setIndex(getIndex() + 1);
		return current();
	}

	@Override
	public E prev() {
		setIndex(getIndex() - 1);
		return current();
	}
}
